<!-- 发布文章 -->
<template>
  <a-page-header
    :style="{ background: 'var(--color-bg-2)' }"
    @back="back"
    title="发布文章"
  >
  </a-page-header>
  <div class="wrap">
    <a-form :model="form.data" @submit="handleSubmit">
      <a-form-item field="name" label="title" hide-label no-style>
        <a-input
          v-model="form.data.title"
          placeholder="请输入标题(最多100个字)"
          size="large"
          style="height: 90px"
          :max-length="100"
          show-word-limit
        />
      </a-form-item>
      <a-form-item field="post" label="content" hide-label no-style>
        <RichTextNew
          v-model:content="form.data.content"
          ref="richText"
          style="width: 100%"
        ></RichTextNew>
      </a-form-item>
    </a-form>
  </div>
  <div class="btns">
    <a-button style="margin-right: 20px">取消发布</a-button>
    <a-button type="primary">发布文章</a-button>
  </div>
</template>
<script setup lang="ts">
const router = useRouter();
const back = () => {
  router.back();
};

const form = reactive({
  data: {
    title: '',
    content: ''
  }
});
</script>
<style lang="less" scoped>
.wrap {
  padding: 20px;
}
.btns {
  background-color: var(--color-bg-2);
  height: 100px;
  line-height: 100px;
  text-align: center;
}
:deep(.w-e-text-container) {
  height: 600px !important;
}
</style>
